<template>
  <div>
    <div>
      <el-table :data="tableData" border style="width: 100%">
        <el-table-column prop="_id" label="_id" width="300"> </el-table-column>
        <el-table-column prop="username" label="用户名" width="300">
        </el-table-column>
        <el-table-column prop="password" label="密码" width="300">
        </el-table-column>
        <el-table-column prop="tel" label="手机号" width="350">
        </el-table-column>
        <el-table-column fixed="right" label="操作" width="200">
          <template slot-scope="scope">
            <el-button @click="handleClick(scope.row)" type="text" size="small"
              >查看</el-button
            >
            <el-button type="text" size="small">编辑</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      tableData: [
        {
          username: "张三",
          password: "qwqeqweqwwqe",
          _id: 213122312231231,
          tel: 12458754125,
        },
        {
          username: "李四",
          password: "wqwqqweeqw",
          _id: 213122312231231,
          tel: 12458754125,
        },
        {
          username: "王五",
          password: "weqeqeqweq",
          _id: 213122312231231,
          tel: 12458754125,
        },
        {
          username: "马六",
          password: "dadwwqeqeq",
          _id: 213122312231231,
          tel: 12458754125,
        },
      ],
    };
  },
  methods: {
    handleClick(row) {
      console.log(row);
    },
  },
};
</script>